Skip to content

fix(core): Tab paints the press for every pointer - #8728

Closed
cixzhang wants to merge 2 commits into
fix/press-release-lands-on-hoverfrom
fix/press-tab-every-pointer-2
Closed

cixzhang wants to merge 2 commits into
fix/press-release-lands-on-hoverfrom
fix/press-tab-every-pointer-2

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

User impact

On desktop, a mouse or pen press on a tab showed only CSS :active's colour: no press from the controller and no release fade, while a finger got both. Under spec:AST-094 FR43 every pointer presses the same way.

After this change, a mouse press on a tab paints the controller's press layer, and the release lands on the tab's hover tint.

Problem and solution fit

  • Why does it happen? Tab's pressed image arms were set only inside @media (pointer: coarse), so the controller's data-astryx-press painted nothing for a mouse.
  • Why does it matter? A tab doesn't answer a click the way the rest of the system now does.
  • What's the fix? The image arms paint for every pointer. The hover and pressed colours yield while the press is on, so a press never paints twice, and paint again over the release so it lands on the hover. That's the same rule as the shared overlay in fix(core): a mouse release lands on the hover the control still has #8727.

Expected behavior and authority

  • spec:AST-094 FR11 and FR43 (DEC-21).

Smallest restoration

Evidence

Tab paints the press for every pointer

  • Reproduction before the change: :active's colour only, then a jump on release (235 → 242).
  • Result after the change: the controller's press layer, then a fade into the hover tint (230 → 234 → 241 → 242), for an unselected tab and the selected one alike.
  • Representative unchanged path: a finger's press on a tab, and a Space press (:active).
  • Regression test: pressEveryPointer.source-build.test.mjs checks that Tab's compiled CSS paints both press arms outside the coarse media.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run packages/core/src/TabList packages/core/src/utils
  • pnpm -F @astryxdesign/core typecheck
  • Real Chromium timelines above.

Supersedes #8714.

Under spec:AST-094 FR43 the press controller paints a mouse's or a pen's
press too (data-astryx-press), not only a finger's. Tab painted its
pressed image only inside @media (pointer: coarse), so a mouse press
showed nothing but :active's colour, with no release fade.

- Its image arms paint the controller's press for every pointer.
- Its hover and pressed colours yield while the press is on, so a press
  never paints twice, and paint again over the release, so a hovering
  pointer's release lands on the tab's hover (as the shared overlay does).

Checkbox and Radio are #8696's; Switch is #8681's.

Test: Tab's compiled CSS paints both arms outside the coarse media.
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 3, 2026 11:19pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 8, 2026, 3:04 AM UTC

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending approval: a mouse or pen press on a tab now paints through the press controller at once and fades onto the hover tint, as spec:AST-094 FR11 and DEC-21 require, and the new source-build test fails on the base and passes here. This lands after its base, #8727. An optional follow-up: under Reduce Motion the release shows the bare tab for one frame before the hover returns, as TopNav items already do through the shared overlay, and a 0s colour transition on the hover layer under prefers-reduced-motion: reduce would remove it.

[Automated review]

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending approval: a mouse or pen press on a tab now paints through the press controller at once and its release fades onto the hover tint, as spec:AST-094 FR11 and DEC-21 require, and the new source-build test fails on the base and passes here. This lands after its base, #8727. An optional follow-up: under Reduce Motion the release shows the bare tab for one frame before the hover fades back in, as TopNav items already do through the shared overlay, and a 0s colour transition on the hover layer under prefers-reduced-motion: reduce would remove it.

[Automated review]

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: one blocking finding, unchanged at this head.

  • Desktop behavior change needs an owner decision: a mouse or pen press on an enabled Tab now paints the press controller's layer instead of :active's colour and fades on release (packages/core/src/TabList/Tab.tsx, lines 164-184), with no touch gate; either gate it to touch input or cite the owner's decision for this desktop behavior in the description.

On the note citing spec:AST-094 FR11 and DEC-21: they describe this press, but on main the mouse press through the press controller has not shipped yet, so this is new desktop behavior rather than a restoration, and the records alone do not carry the owner's decision for it. The non-blocking comment and test suggestions from the earlier review still apply. This lands only after its base, #8727.

[Automated review]

Comment on lines 177 to 184
[stylex.when.ancestor('[data-astryx-press="on"]', tabScope)]: {
default: null,
default: pressedOverlayImage,
'@media (pointer: coarse)': pressedOverlayImage,
},
[stylex.when.ancestor('[data-astryx-press="fading"]', tabScope)]: {
default: null,
default: pressedOverlayImage,
'@media (pointer: coarse)': pressedOverlayImage,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: desktop behavior change needs an owner decision. These unconditioned arms, with the colour yield at lines 164-168, make a mouse or pen press paint the controller's layer instead of :active's colour, and the release then fades over about 190 ms. Nothing gates this to touch input. Gate it to touch input, or cite the owner's decision in the description.

Comment on lines +160 to +163
// While the press is on, the hover and pressed colours yield to the
// image (same shape as the arm above, so it outranks it). Over the
// release they paint again: a hovering pointer's hover sits beneath the
// fading image, so the release lands on it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the first sentence carries two topics (the yield, and why this arm wins). Suggested:

// While the press is on, the hover and pressed colours yield to the image.
// This arm has the `:active` arm's shape, so it compiles after it and wins.
// Over the release the colours paint again, so the release lands on the hover.

Comment on lines 170 to +174
// The touch press, as an image layer over the colour: an image change is
// discrete, so the layer's colour transition cannot fade the onset in,
// and the strength the tab's `pressedAlpha` arms own (1 while on, 1 → 0
// over the release) is what moves. Coarse pointers only, like the colour
// arms above; see interactionOverlay.stylex.ts.
// over the release) is what moves. Every pointer: a mouse paints at once;
// see interactionOverlay.stylex.ts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this still opens with "The touch press", but the layer now paints every pointer's press, and the first sentence runs past 40 words. Suggested:

// The press paints as an image over the colour. An image change is
// discrete, so the colour transition cannot fade the onset in. The tab's
// `pressedAlpha` arms move the strength instead: 1 while on, 1 → 0 over
// the release.

Comment on lines +86 to +92
for (const arm of ['on', 'fading']) {
const rules = pressImageRules(css, arm);
expect(rules.length, `${control} ${arm}`).toBeGreaterThan(0);
expect(
rules.some(rule => !rule.coarseOnly),
`${control} ${arm}`,
).toBe(true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this pins only the image arms. Deleting the colour yield (Tab.tsx lines 164-168) keeps it green, though a hover-capable desktop would then paint :active's 10% under the image. You could also assert a [data-astryx-press="on"] rule with background-color:transparent outside the coarse media.

@humbertovirtudes humbertovirtudes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 4b7e067. The change itself looks correct and in scope; holding approval on its base.

Authority: a mouse or pen press replacing :active is admitted by spec:AST-094 FR11 (under a fine pointer the press paints "through the same press controller and release fade as a finger's, in place of CSS :active") and DEC-21, both authority: current. The earlier automated request to gate this to touch can be resolved by citing those.

Base: this PR targets fix/press-release-lands-on-hover (#8727), which in turn targets stack/press-on-8682. #8682 was closed as superseded by #9762 and #9783, and on main the press controller still paints a mouse press only where the stylesheet dropped :active (pressFeedback.ts, stylesheetDroppedActive). So this change takes effect only on top of that stack, and because the base is not main, the CI workflow has not run tests, lint or typecheck at this head. I suggest redoing these three files against main once the press-for-every-pointer work (#8469) settles, then I am happy to approve with green CI.

Non-blocking:

  1. pressEveryPointer.source-build.test.mjs:90 pins only the image arms. Deleting the colour yield at Tab.tsx:164-168 keeps it green. Consider also asserting a [data-astryx-press="on"] rule with background-color:transparent outside the coarse media.
  2. Tab.tsx:179 and :183: the (pointer: coarse) arms now equal their defaults and can be dropped.
  3. Tab.tsx:103, :170 and :405 still describe this as the touch press.
  4. The test covers only Tab; colocating it as TabList/Tab.press.source-build.test.mjs would match sibling source-build tests, unless more controls are planned for the list.

@astracat-bot

astracat-bot Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

In reply to @humbertovirtudes

I'll run a full review to re-check this with your note.

@cixzhang

Copy link
Copy Markdown
Contributor Author

(Posted by Cindy's agent.) Closing: this was stacked on #8682, which closed without merging (superseded by the touch press-token work), so it has no path to main and no fine-pointer press ships today. Re-raise if a fine-pointer (mouse/pen) press through the press controller comes back.

@cixzhang cixzhang closed this Nov 12, 2026
@github-actions
github-actions Bot deleted the fix/press-tab-every-pointer-2 branch November 13, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 4b7e067b Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants